<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>const</title>
</head>
<body>
    
</body>
<script>
    var PI = 3.1415926;
    if(true){ 
        //代码块内部，暂时性不能使用PI
        console.log(PI);
        //该代码中的PI就是用const定义的
        const PI = "123"
    }
    console.log(PI)//3.1415926
  </script>
</html>